//
//  JobDetailSupportTableViewCell.swift
//  GreenDeal
//
//  Created by Moennig Q on 27/12/2022.
//
import UIKit
class JobDetailSupportTableViewCell: TableViewCell {
    let typeImageView = UIImageView()
    let titleLabel = ContentLabel(R.font.interSemiBold(size: 16))
    override func setUpviews() {
        //type image view
        self.contentView.addSubview(typeImageView)
        typeImageView.snp.makeConstraints { make in
            make.top.equalTo(16)
            make.left.equalToSuperview()
            make.width.height.equalTo(30)
            make.bottom.equalToSuperview()
        }
        
        //title label
        titleLabel.numberOfLines = 0
        self.contentView.addSubview(titleLabel)
        titleLabel.snp.makeConstraints { make in
            make.left.equalTo(typeImageView.snp.right).offset(12)
            make.centerY.equalTo(typeImageView)
            make.height.width.greaterThanOrEqualTo(0)

        }
    }
    func setData(_ type: SupportType){
        if type == .phone {
            titleLabel.text = APPConfig.SupportPhone
            typeImageView.image = R.image.jobdetail_support_phone_icon()
        }else if type == .email {
            titleLabel.text = APPConfig.SupportEmail
            typeImageView.image = R.image.jobdetail_support_email_icon()
        }
    }
}
